function result(status,data,msg){
    this.status = status;
    this.data = data || {};
    this.msg = msg;
}
function random(req,res){
    let ti = new Date();
    let hour = ti.getHours();
    let minute = ti.getMinutes();

    let data = `测试接口，现在时间是${new Date().toLocaleTimeString()},${context(hour,minute)}`
    res.send(new result(200,data,'ok'))
}
function context(hour,minute){
    if(hour===17&&minute>=30||hour>17){
        return '已经下班了！'
    }else if(hour===17&&minute<30){
        return '还有'+(30-minute)+'分钟下班!'
    }else{
        return '还有'+((17-hour)*60+minute)+'分钟下班!'
    }
}

module.exports = random